package com.hy.app;

import android.opengl.GLSurfaceView;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

public class NativeColorRender implements GLSurfaceView.Renderer {
    static {
        System.loadLibrary("native-render");
    }

    public native void onSurfaceCreated(int color);

    public native void onSurfaceChanged(int width, int height);

    public native void onDrawFrame();

    private final int color;

    public NativeColorRender(int color) {
        this.color = color;
    }

    @Override
    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
        onSurfaceCreated(color);
    }

    @Override
    public void onSurfaceChanged(GL10 gl, int width, int height) {
        onSurfaceChanged(width, height);
    }

    @Override
    public void onDrawFrame(GL10 gl) {
        onDrawFrame();
    }
}